import $store from '@/sheep/store';
import $api from '@/sheep/api';
import $url from '@/sheep/url';
import $router from '@/sheep/router';
// import $platform from '@/sheep/platform';
import $helper from '@/sheep/helper';
// import zIndex from '@/sheep/config/zIndex.js';
import $config from '@/sheep/config';
// import dayjs from 'dayjs';
// import relativeTime from 'dayjs/plugin/relativeTime';
// import duration from 'dayjs/plugin/duration';
// import 'dayjs/locale/zh-cn';

// dayjs.locale('zh-cn');
// dayjs.extend(relativeTime);    
// dayjs.extend(duration);
import { changeReadModal } from "@/sheep/hooks/useModal.js"
const sheep = {
  $api,
  $store,
  $config,
  $url,
  $router,  
  // $platform,
  $helper,
  // $zIndex: zIndex,
};

// 加载Shopro底层依赖
export async function startInit(query) {
	let isLogin = $store('user').isLogin
	if(!uni.getStorageSync('language')) uni.setStorageSync('language', 'zh-Hans')
	if(isLogin) $store('user').getInfo()
	$store('app').getBrandList()
	$store('app').getYewulists()
	$store('app').getJyproject()
	$store('app').getZzproject()
	$store('app').getConfig()
}

// 开发模式
function ShoproDebug() {
  // 开发环境引入vconsole调试
  // #ifdef H5
  // import("vconsole").then(vconsole => {
  // 	new vconsole.default();
  // });
  // #endif

  // 同步前端页面到后端
  $api.app.pageSync(ROUTES);
}

export default sheep;
